OK, let's just get right into it because I'm pretty excited, and I know you are too.
Make sure you open the Lua documentation that comes with AlephOne.  It's mostly unhelpful,
but there may be a few pieces of useful information buried in there.

=== Triggers ===

The first thing you'll notice is a section called Triggers.  What you need to realize is
that idle is the only trigger worth anything, so make sure to put most of your code in
there.  Now you may be asking, "What are the other triggers for then?".  I'm glad you asked.
Let's step through an example.

A common thing people want to know when writing scripts is whether or not a minor tick is
currently dying hard.  The monster_killed trigger is what you want to use in this case.
Your code will look something like this:

function Triggers.monster_killed(monster, aggressor_player, projectile)
  ... code here to determine whether a tick is dying hard.  If so set a global variable like so:
  monster_minor_tick_is_dying_hard = true
end

Then it's as easy as checking the variable in idle!

function Triggers.idle()
	if monster_minor_tick_is_dying_hard then
	  .. do whatever
	and  you can do all sorts of cool stuff now
end

See that wasn't so bad, right?  Always use triggers other than idle to set global variables with
long names, and then put the real code in idle.  Writing your code like this makes it super easy
to understand because it's almost like you're reading english!

=== Data Structures ===

Tables are very useful in Lua.  For example, let's say you want to keep track of the number of
monsters currently on the map, and assign it to a variable associated with each player.  This
comes up all the time.  Let's use a table!

If you've used Mirosoft Excel before, you're already familiar with tables, let's go ahead and
assign our variables in columns and rows

Player1_MonsterCount	Player2_MonsterCount	Player3_MonsterCount	Player4_MonsterCount


Player5_MonsterCount	Player6_MonsterCount	Player7_MonsterCount	Player8_MonsterCount

Make sure to double space your tables.  Also notice that this particular table has 2 rows.  That's
because there will be 8 players and Lua can only support maximum column widths of 4.  Notice how
I said there "will" be 8 players.  If you intend to host a game with fewer players, you will need
to use a separate script with a different number of entries in the table.

If the table doesn't look right to you, your editor may be screwing up the formatting.  This is why
most developers prefer to use an IDE.  The more expensive, the better.

OK great, we've got our table, but what do we do with it?

=== Loops ===

Let's loop through the entries in our table and assign the values!

for i=1,10000 do -- loop 10,000 times to make sure we get everything
	if i == 1 then
		-- Let's assume get_monster_count is a function that loops through all of the polygons,
		-- and adds 1 for each monster in that polygon.  Finally it returns the total count.
		num = get_monster_count()
		Player1_MonsterCount = num
	end
	
	if i == 2 then
		num = get_monster_count()
		Player2_MonsterCount = num
	end
	
	if i == 3 then
		num = get_monster_count()
		Player3_MonsterCount = num
	end
	
	if i == 4 then
		num = get_monster_count()
		Player4_MonsterCount = num
	end
	
	if i == 5 then
		num = get_monster_count()
		Player5_MonsterCount = num
	end
	
	if i == 6 then
		num = get_monster_count()
		Player6_MonsterCount = num
	end
	
	if i == 7 then
		num = get_monster_count()
		Player7_MonsterCount = num
	end
	
	if i == 8 then
		num = get_monster_count()
		Player8_MonsterCount = num
	end
end

And BAM, it's done.  In just over 40 lines of code, we were able to achieve something that would have
taken over 10,000 lines without using a loop.  It doesn't get much simpler than that!

I'm actually getting tired of writing this now, and I'm getting hungry, so I'm going to leave it here.
Have fun coding!
